relabelVars = function(thedata) {
  thedata[["vars"]] = mapvalues(thedata[["vars"]], warn_missing = F,
                                 from = c("AOA", "AOS30", "AOS60", "AOS90",
                                          "post45", "contig", 
                                          "maj",
                                          "issues", "cincP", "logBattles", "nBattleTrend",
                                          "anyDipEnemy",
                                          "nuk",
                                          "nBellig", 
                                          "apropdiff", "apropdiffDOE", "minor", 
                                          "polBinA",
                                          "doeWinLose",
                                          "keyAllies", 
                                          "neg", "negExt", "negInt",
                                          "ceasefire"),
                                 to = c("Overall\nimbalance", "Recent\nimbalance", "Recent\nimbalance", "Recent\nimbalance", 
                                        "Post-1945", "Contiguity", 
                                        "Major power", 
                                        "Issue salience", "CINC ratio", "Completed\nbattles", "Active\nbattle trend",
                                        "Opp. diplomatic\nrepresentation",
                                        "Nuclear",
                                        "Number of states",  
                                        "Inconsistency", "Inconsistency\n(DOE)", "Minor-power war", 
                                        "Democratic\ninitiator",
                                        "DOE score", 
                                        "Major allies",
                                        "All negotiation", "External\nnegotiation", "Internal\nnegotiation",
                                        "Ceasefire"))
  
  # Remove interactions that were included to help with proportional hazards assumption
  thedata = thedata %>% filter(!grepl("\\:", vars))
  
  # Reorder variables
  thedata[["vars"]] = factor(thedata[["vars"]], 
                      levels = c("All negotiation", "Internal\nnegotiation", "External\nnegotiation", "Minor-power war", "Post-1945",
                                 "Ceasefire",
                                 "Recent\nimbalance", "Overall\nimbalance", 
                                 "Inconsistency", "Inconsistency\n(DOE)", 
                                 "Issue salience", "Contiguity", "CINC ratio", "DOE score",
                                 "Democratic\ninitiator",
                                 "Major/Nuclear", "Major power", "Nuclear", "Number of states", 
                                 "Opp. diplomatic\nrepresentation", 
                                 "Major allies",
                                 "Completed\nbattles", "Active\nbattle trend"
                                 ))
  
  return(thedata)
}

